Skip to content

08. News and updates

Indranil Sinharoy edited this page Apr 18, 2017 · 4 revisions

October 02, 2016: Updated to version 2.0.3

  1. Fixed issues #65, #66, which arose due to a recent format change adopted in the latest version of OpticStudio in the text files outputted by OpticStudio.

January 03, 2016: Updated to version 2.0.2

  1. Added new APR (Automatic Push Refresh) mode for efficient interactivity with the lens in main Zemax window (LDE) from a Python shell. This mode avoids the repeated use of push and refresh commands to move a lens back and forth between the LDE and the DDE server. See a quick demo here

  2. Added a new module called misc (import as pyzdde.misc). This module is intended to contain a collection of useful functions that make use of the core pyzdde functions.

  3. Removed the redundant function ipzCaptureWindow2()

  4. Added several helper functions to directly modify lens parameters in the LDE like zGetSemiDiameter(), zGetThickness(), zSetThickness(), zGetRadius(), etc. Other functions added include zGetMagnification(), zGetAngularMagnification(), ipzGetFieldData(), zAnyOffAxisField(), etc.

  5. Fixed bug in the function zTiltDecenterElements(). See issue 59.

  6. Fixed html based rich text display issue for displaying operand and button codes in Jupyter notebook.

  7. Added useful fields to the PSFinfo metadata returned by the function zGetPsf(). See here for details. Thanks Ben


September 01, 2015: Updated to version 2.0.1

No significant update between 2.0.0 and 2.0.1. (The minor version number needed to be bumped in order to fix a README.rst rendering problem in the PyPI website)


July 25, 2015: Updated to version 2.0.0

  1. Added the following NSC helper functions:

    • zSetNSCPositionTuple()
    • zInsertNSCSourceEllipse()
    • zInsertNSCSourceRectangle()
    • zInsertNSCEllipse()
    • zInsertNSCRectangle()
    • zInsertNSCDetectorRectangle()
    • zNSCDetectorClear()
  2. Removed asymmetry in several function parameters names. PLEASE NOTE that this change has the potential of breaking existing code. However, I hope that in the long run these changes will be beneficial as it provides a much cleaner and uniform parameter-naming scheme. The following list shows the parameters that were renamed in several functions.

    • surfaceNumber ==> surfNum
    • objectNumber ==> objNum
    • surfNumber ==> surfNum
    • objNumber ==> objNum
    • detectorObjNum ==> detectNum
    • faceNumber ==> faceNum
    • paramNumber ==> paramNum
    • parameter ==> param
    • operandNumber ==> operNum
    • columnNumber ==> colNum
    • configNumber ==> configNum
    • bufferNumber ==> bufferNum
    • dataNumber ==> dataNum
    • windowNumber ==> windowNum
    • apertureValue ==> aperVal
    • settingsFileName ==> settingsFile
    • objNumSrc ==> srcNum

June 18, 2015: Updated to version 1.1.1

PyZDDE installable package available through PyPI

Other changes

The default text encoding was changed from 'ascii' to 'unicode' to reflect the default behaviour of latest OpticStudio.


June 7, 2015: Updated to version 1.1.00

New features
  1. Added a new module called zfileutils. This module shall contain all helper functions related to reading and writing to files used by OpticStudio, such as readZRDFile(), writeZRDFile(), readBeamFile(), writeBeamFile(), gridSagFile(), etc. See a brief description of the top level modules here.
  2. New functions in zdde module:
    • zTiltDecenterElements(): function emulates the behavior of TiltDecenterElements lens modification feature of Zemax.
    • gridSagFile() and randomGridSagFile(): added to zfileutils module, these helper functions can help quickly create grid sag surfaces with extensions .DAT or .GRD as described in the manual.
Changes
  1. Improvements to existing functions:
    • zGetPOP(): modified such that the function also returns the surface number in the popinfo field. Also changed the names of input arguments start_surf and end_surf to startSurf and endSurf.
    • zImportExtraData() : minor improvements to appropriately parse return value from Zemax.
  2. Several other improvements to code including:
    • addition of mnemonic codes as PyZDDE class variables to specify parameters for functions such as setSolve(), getSolve() that can be easily understood during code reading.
    • minor improvements in unittest module.

Feb 3, 2015: Updated to version 1.0.00-alpha

New features

This is a major release as PyZDDE is now feature complete with the addition of array tracing functions.

A separate and standalone array tracing module (pyzdde.arraytrace) was added that can be used independently (and simultaneously if required) with the existing pyzdde.zdde module. This module, which is useful for doing array ray tracing as described in Zemax manual, defines the DDE ray data structure using ctypes, and provides the following two main functions:

  1. zArrayTrace() -- The main function for calling Zemax for array ray tracing
  2. getRayDataArray() -- Helper function that creates the ctypes ray data structure array, fills up the first element and returns the array

In addition to the above two functions, the following helper functions are provided that supports 5 different modes discussed in the Zemax manual

  1. zGetTraceArray()
  2. zGetTraceDirectArray()
  3. zGetPolTraceArray()
  4. zGetPolTraceDirectArray()
  5. zGetNSCTraceArray()

The functions have been tested functionally, so I am quite confident about its reliability. I am sure the performance could be tweaked in future releases. There are two examples in "Examples/Scripts" folder that emulate the standard "ArrayDemo.c" and "NSCTraceDemo.c" code examples which are shipped with Zemax. The outputs from the Python code examples exactly match the outputs of the c examples supplied by Zemax. In addition, a script (parityAndSpeedTestOfArrayTracingFuncs.py) to compute the running time of the functions and verify the outputs of the helper functions has been added to "Examples/Misc" folder.

Thanks to Ian Rousseau and Julian Stürmer for their help on the array ray tracing module. Ian sent me a working code for tracing large number of rays sometime back, which gave me some crucial ideas about the current implementation. Julian, who was also successful in implementing array ray tracing using ctypes, communicated several ideas with me about the implementation.

We have also added a new function, zGetZernike() that returns the Zernike Fringe, Standard, or Annular coefficients for the currently loaded lens file. It provides similar functionality as the ZPL command "GETZERNIKE".

Bugfixes
  1. Function zGetPolTraceDirect() in pyzdde.zdde fixed -- the parameter z was getting assigned to y during the creation of dde command, and the command itself was not accurate as it was missing the commas between the sub-commands.
  2. There was similar problems (missing commas) with the function zGetPolTrace() that has been fixed.
Changes
  1. Functions zGetNSCSettings(), zGetPolTrace() and zGetPolTraceDirect() updated to returned Python namedtuple
  2. Changed the field names of the namedtuples returned by the functions zGetTrace() and zGetTraceDirect() from errorCode to error and vigCode to vig.

July 13, 2014: Updated to version 0.8.0

The following functions (27) were added in this release:

Analysis functions:
  • zGetPSFCrossSec(),
  • zModifyFFTPSFSettings(),
  • zSetFFTPSFCrossSecSettings(),
  • zSetHuygensPSFCrossSecSettings(),
  • zModifyHuygensPSFCrossSecSettings(),
  • zGetPSF(),
  • zSetFFTPSFSettings(),
  • zModifyFFTPSFSettings(),
  • zSetHuygensPSFSettings(),
  • zModifyHuygensPSFSettings(),
  • zGetMTF(),
  • zSetFFTMTFSettings(),
  • zModifyFFTMTFSettings(),
  • zSetHuygensMTFSettings(),
  • zModifyHuygensMTFSettings(),
  • zGetImageSimulation(),
  • zSetImageSimulationSettings(),
  • zModifyImageSimulationSettings(),
Other functions:
  • readBeamFile() [thanks to @CatherineH (github)],
  • writeBeamFile() [(thanks to @CatherineH github)],
  • zGetNumField(),
  • zGetNumSurf(),
  • zGetNumWave(),
  • zGetImageSpaceNA(),
  • zGetIndexPrimWave(),

These functions (more shall be added in future) are utility functions to quickly create simple optical systems

  • zMakeIdealThinLens() (in pyzdde.systems module),
  • zMakeIdealCollimator() (in pyzdde.systems module),
Function name changes:

zCalculateHiatus() to zGetHiatus()

Other changes
  • long parameter names for some functions were shortened for better interactivity.
  • several internal helper functions (in addition to the above) were added to support the above functions.

June 21, 2014: Updated to version 0.7.7

  • Added 3 functions for Physical Optics Propagation (POP) analysis. Big thanks to @CatherineH [github]. The functions added are zGetPOP(), zSetPOPSettings(), and zModifyPOPSettings().
  • Although there were no API changes, there is a slight chance that code using earlier versions of PyZDDE may break. This is because of the code clean-up that has happened. Specifically, the parameter names of the following functions were shortened:
    • zGetMetaFile() :: settingsFileName to settingsFile
    • zGetTextFile() :: settingsFileName to settingsFile
    • zCalcuateHiatus() :: txtFileName2Use to txtFile
    • zGetSeidelAberration() :: txtFileName2Use to txtFile
    • ipzCaptureWindow() :: settingsFileName to settingsFile

May 11, 2014: Updated to version 0.7.6

  • Added helper functions to easily and quickly create and close DDE communication link objects. Interface functions added include pyz.createLink(), pyz.closeLink() and link.close(). So now, instead of calling ln = pyz.PyZDDE() and then ln.zDDEInit(), the user can just call pyz.createLink() which will instantiate a PyZDDE object, initialize it and return the object. For closing communication the user can either call ln.close() (which is a method bound to the particular DDE link instance) or call pyz.closeLink(link=None). This method allows the user to close a particular link (if there are 2 simultaneous links) or close all live links. It is recommended to use these methods for creating and closing links as they are easy and quick to use and manages all the creation and cleaning of link objects for you. Note that existing programs will not break because internally these helper functions use the existing API for creating and closing DDE links.
  • Renamed ipzCaptureWindow2() to ipzCaptureWindow() because ipzCaptureWindow2() is a better function and was used most often. Again, as above, existing code using ipzCaptureWindow2() will not break because the function remains defined and just re-directs calls to ipzCaptureWindow(). Renamed the low quality image capture function (originally named as ipzCaptureWindow()) to ipzCaptureWindowLQ().
  • Code re-factoring in several places to make the logic better and more Pythonic.
  • Several zGetxxx functions were modified to return namedtuples instead of tuples for better human understanding. (Not all functions are converted; this will be an ongoing process for some time)
  • Bug fix. A bug was introduced in the previous version (v0.7.5) in function spiralSpot() when the list comprehensions were converted to generator expressions for better memory efficiency. The generated values of 'theta' were getting consumed at twice the rate of consumption of 'r' since both 'r' and 'pXY' were requesting for 'theta' from the same source. It has been fixed.

May 05, 2014: Updated to version 0.7.5

  • Added support for using Unicode text encoding in Zemax (using two module level functions setTextEncoding and getTextEncoding)
  • Fixed issue #24 link to support extended ASCII characters.
  • API change of the function zPushLens: The argument "updateFlag" was changed to just "update". Less tying is good for interactive programming.

Apr 19, 2014: Updated to version 0.7.4

  • Added support for Python 3.3 and above along with Python 2.7
  • Removed using PyWin32 for DDEML communication. PyZDDE will only use ddeclient.

Apr 16, 2014: Updated to version 0.7.3

  • Bug fix in functions zGetSystemProperty and zGetPolTraceDirect.

Mar 21, 2014: Updated to version 0.7.2

  • Added ability to set timeout value both globally to all functions for communicating with ZEMAX and individually for some functions which may require higher value of timeout.
  • Moved dde request handling from PyWin32 to dde_backup module in pyzdde (this is now the default behavior) as PyWin32 dde requests didn't allow to change dde timeout value.
  • Couple of figure handling utility functions added for quick handling of image arrays.

Feb 16, 2014: Updated to version 0.7.0

  • Added backup dde module that can be used by PyZDDE if pywin32's dde module results in import error.

Feb 14, 2014: Updated to version 0.6.0

  • Feature addition - option to return pixel array of graphical analysis windows using ipzCaptureWindow2 instead of embedding figure into an IPython notebook or QtConsole.
  • Couple of bug-fixes.

Jan 22, 2014: